{template 'public/header'}
{template 'public/comhead'}
<link rel="stylesheet" type="text/css" href="../addons/hyb_o2o/template/public/ygcsslist.css">
<style type="text/css">
    .yg5_key>div{float: left;line-height: 34px;}
    .store_td1{height: 45px;}
    .store_list_img{width: 40px;height: 40px;}
    .yg5_tabel{border-color: #e5e5e5;outline: 1px solid #e5e5e5;}
    .yg5_tr2>td{padding: 10px;border: 1px solid #e5e5e5;text-align: center;}
    .yg5_tr1>td{
        border: 1px solid #e5e5e5;
        padding-left: 15px;
        background-color: #FAFAFA;
        font-weight: bold;
        text-align: center;
    }
    .yg5_btn{background-color: #EEEEEE;color: #333;border: 1px solid #E4E4E4;border-radius: 6px;width: 100px;height: 34px;}
    .jfbtn{background-color: #44ABF7;color: white;}
    .jfbtn:hover{background-color: #44ABF7;color: white;}
</style>
<ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>    
    <li {if $op=="display"} class="active" {/if}><a href="{php echo $this->createWebUrl('jfthumb',array('op'=>'display'))}">幻灯片列表</a></li>
    <li {if $op=="post"} class="active" {/if}><a href="{php echo $this->createWebUrl('jfthumb',array('op'=>'post'))}">添加幻灯片</a></li>
</ul>
{if $op == "display"}
<div class="main">
        <div class="panel panel-default">
            <div class="panel-heading">
                积分幻灯片列表
            </div>
            <div class="panel-body" style="padding: 0px 15px;">
                <div class="row">
                    <table class="yg5_tabel col-md-12">
                        <tr class="yg5_tr1">
                            <td class="store_td1 col-md-1">顺序</td>
                            <td class="col-md-1">图片</td>
                            <td class="col-md-2">小程序跳转appid</td>
                            <td class="col-md-1">小程序跳转链接</td>
                            <td class="col-md-1">操作</td>
                        </tr>
                        {loop $list $row}
                        <tr class="yg5_tr2">
                            <td>{$row['id']}</td>
                            <td>
                                <img class="store_list_img" src="{media  $row['thumb']}" alt=""/>
                            </td>
                            <td>{$row['appid']}</td>
                            <td>{$row['path']}</td>
                            <td>
                                <a href="{php echo $this->createWebUrl('jfthumb', array('id' => $row['id'],'op'=>'post'))}" class="storespan btn btn-xs">
                                    <span class="fa fa-pencil"></span>
                                    <span class="bianji">编辑
                                        <span class="arrowdown"></span>
                                    </span>
                                </a>
                                <a href="{php echo $this->createWebUrl('jfthumb', array('id' => $row['id'],'op'=>'delete'))}" class="storespan btn btn-xs">
                                    <span class="fa fa-trash-o"></span>
                                    <span class="bianji">删除
                                        <span class="arrowdown"></span>
                                    </span>
                                </a>
                            </td>
                        </tr>
                        {/loop}
                    </table>
                </div>
            </div>
        </div>
   
</div>
<div class="text-right we7-margin-top">{$pager}</div>
{/if}
{if $op == "post"}
<div class="main">
    <form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
        <div class="panel panel-default ygdefault">
            <div class="panel-heading wyheader">
                添加积分幻灯片
            </div>
            <div class="form-group" style="margin-top: 20px;">
                <label for="" class="control-label col-sm-1">幻灯片</label>
                <div class="form-controls col-sm-5" style="margin-left: 75px;">
                    {php echo tpl_form_field_image('thumb', $items['thumb'])}
                </div>
                <div class="col-sm-1"></div>
                <div class="form-controls col-sm-4 help-block">幻灯片</div>
            </div> 
            <div class="form-group" style="margin-top: 20px">
                <label for="" class="control-label col-sm-1">小程序跳转appid</label>
                <div class="form-controls col-sm-5" style="margin-left: 75px;">
                    <input type="text" name="appid" value="{$items['appid']}" class="form-control ng-pristine ng-untouched ng-valid ng-empty"  placeholder="" autocomplete="off">
                </div>
                <div class="col-sm-1"></div>
                <div class="form-controls col-sm-4 help-block" style="color: red">小程序跳转appid</div>
            </div>     
            <div class="form-group" style="margin-top: 20px">
                <label for="" class="control-label col-sm-1">小程序跳转链接</label>
                <div class="form-controls col-sm-5" style="margin-left: 75px;">
                    <input type="text" name="path" value="{$items['path']}" class="form-control ng-pristine ng-untouched ng-valid ng-empty"  placeholder="" autocomplete="off">
                </div>
                <div class="col-sm-1"></div>
                <div class="form-controls col-sm-4 help-block" style="color: red">小程序跳转链接[例如: /hyb_o2o/index/index]</div>
            </div> 
        <div class="form-group" style="margin-top: 20px; margin-left: 30px;">
            <input type="submit" name="submit" value="提交" class="btn col-lg-3" style="color: white;background-color: #44ABF7;"/>
            <input type="hidden" name="token" value="{$_W['token']}" />
        </div>
    </form>
</div>
{/if}
<script type="text/javascript">
    $(function(){
        $("#frame-8").show();
        $("#yframe-8").addClass("wyactive");
    })
</script>
{template "common/footer"}